import 'package:flutter/material.dart';
import 'page1.dart';
import 'page2.dart';
import 'page3.dart';
import 'page4.dart';
class sliding_items extends StatelessWidget {
  const sliding_items({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        SizedBox(height: 28),
        homepage_sliding_contianer(),
      ],
    );
  }
}

class homepage_sliding_contianer extends StatelessWidget {
  const homepage_sliding_contianer({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        Navigator.of(context).push(MaterialPageRoute(builder: (context) {
          return Page1();
        }));
      },
      child: Container(
        margin: EdgeInsets.only(top: 0.0, left: 0.0),
        constraints: BoxConstraints.tightFor(width: 400.0, height: 200.0),
        decoration: BoxDecoration(
            gradient: RadialGradient(
                colors: [Colors.blueGrey, Colors.blueGrey.shade900],
                center: Alignment.topLeft,
                radius: 1),
            // gradient 适用于渐变色的控制的
            borderRadius: BorderRadius.all(Radius.circular(15)),
            boxShadow: [
              BoxShadow(
                  color: Colors.black45,
                  offset: Offset(3.0, 3.0),
                  blurRadius: 4.0)
            ]),
        alignment: Alignment.center,
        child: Flex(
          direction: Axis.vertical,
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            Expanded(flex: 1, child: Container()),
            Expanded(
              flex: 2,
              child: Text(
                "可回收垃圾",
                style: TextStyle(
                  color: const Color(0xffa68a64),
                  fontSize: 30.0,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
            Expanded(
              flex: 1,
              child: Text(
                "可再生循环利用",
                style: TextStyle(
                  color: const Color(0xffa68a64),
                  fontSize: 20.0,
                  fontWeight: FontWeight.bold,
                ),
              ),
            ),
            Expanded(flex: 1, child: Container()),
          ],
        ),
      ),
    );
  }
}

class sliding_items_2 extends StatelessWidget {
  const sliding_items_2({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        SizedBox(height: 28),
        homepage_sliding_contianer_2(),
      ],
    );
  }
}

class homepage_sliding_contianer_2 extends StatelessWidget {
  const homepage_sliding_contianer_2({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
        onTap: () {
          Navigator.of(context).push(MaterialPageRoute(builder: (context) {
            return Page2();
          }));
        },
        child: Container(
          margin: EdgeInsets.only(top: 0.0, left: 0.0),
          constraints: BoxConstraints.tightFor(width: 400.0, height: 200.0),
          decoration: BoxDecoration(
              gradient: RadialGradient(
                  colors: [const Color(0xff936639), const Color(0xffa68a64)],
                  center: Alignment.topLeft,
                  radius: 1),
              // gradient 适用于渐变色的控制的
              borderRadius: BorderRadius.all(Radius.circular(15)),
              boxShadow: [
                BoxShadow(
                    color: Colors.black45,
                    offset: Offset(3.0, 3.0),
                    blurRadius: 4.0)
              ]),
          alignment: Alignment.center,
          child: Flex(
            direction: Axis.vertical,
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Expanded(flex: 1, child: Container()),
              Expanded(
                flex: 2,
                child: Text(
                  "有害垃圾",
                  style: TextStyle(
                    color: const Color(0xff582f0e),
                    fontSize: 30.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(
                flex: 1,
                child: Text(
                  "有害健康需特殊处理",
                  style: TextStyle(
                    color: const Color(0xff582f0e),
                    fontSize: 20.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(flex: 1, child: Container()),
            ],
          ),
        ));
  }
}

class sliding_items_3 extends StatelessWidget {
  const sliding_items_3({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        SizedBox(height: 28),
        homepage_sliding_contianer_3(),
      ],
    );
  }
}

class homepage_sliding_contianer_3 extends StatelessWidget {
  const homepage_sliding_contianer_3({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
        onTap: () {
          Navigator.of(context).push(MaterialPageRoute(builder: (context) {
            return Page3();
          }));
        },
        child: Container(
          margin: EdgeInsets.only(top: 0.0, left: 0.0),
          constraints: BoxConstraints.tightFor(width: 400.0, height: 200.0),
          decoration: BoxDecoration(
              gradient: RadialGradient(
                  colors: [const Color(0xffb6ad90), const Color(0xffa4ac86)],
                  center: Alignment.topLeft,
                  radius: 1),
              // gradient 适用于渐变色的控制的
              borderRadius: BorderRadius.all(Radius.circular(15)),
              boxShadow: [
                BoxShadow(
                    color: Colors.black45,
                    offset: Offset(3.0, 3.0),
                    blurRadius: 4.0)
              ]),
          alignment: Alignment.center,
          child: Flex(
            direction: Axis.vertical,
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Expanded(flex: 1, child: Container()),
              Expanded(
                flex: 2,
                child: Text(
                  "厨余（湿）垃圾",
                  style: TextStyle(
                    color: const Color(0xff333d29),
                    fontSize: 30.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(
                flex: 1,
                child: Text(
                  "会发霉变馊腐烂",
                  style: TextStyle(
                    color: const Color(0xff333d29),
                    fontSize: 20.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(flex: 1, child: Container()),
            ],
          ),
        ));
  }
}

class sliding_items_4 extends StatelessWidget {
  const sliding_items_4({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        SizedBox(height: 28),
        homepage_sliding_contianer_4(),
      ],
    );
  }
}

class homepage_sliding_contianer_4 extends StatelessWidget {
  const homepage_sliding_contianer_4({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
        onTap: () {
          Navigator.of(context).push(MaterialPageRoute(builder: (context) {
            return Page4();
          }));
        },
        child: Container(
          margin: EdgeInsets.only(top: 0.0, left: 0.0),
          constraints: BoxConstraints.tightFor(width: 400.0, height: 200.0),
          decoration: BoxDecoration(
              gradient: RadialGradient(
                  colors: [const Color(0xff414833), const Color(0xff333d29)],
                  center: Alignment.topLeft,
                  radius: 1),
              // gradient 适用于渐变色的控制的
              borderRadius: BorderRadius.all(Radius.circular(15)),
              boxShadow: [
                BoxShadow(
                    color: Colors.black45,
                    offset: Offset(3.0, 3.0),
                    blurRadius: 4.0)
              ]),
          alignment: Alignment.center,
          child: Flex(
            direction: Axis.vertical,
            mainAxisAlignment: MainAxisAlignment.start,
            children: [
              Expanded(flex: 1, child: Container()),
              Expanded(
                flex: 2,
                child: Text(
                  "其他（干）垃圾",
                  style: TextStyle(
                    color: const Color(0xffa4ac86),
                    fontSize: 30.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(
                flex: 1,
                child: Text(
                  "难以回收与辨认",
                  style: TextStyle(
                    color: const Color(0xffa4ac86),
                    fontSize: 20.0,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
              Expanded(flex: 1, child: Container()),
            ],
          ),
        ));
  }
}
